import request from '@/utils/request';

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/api/order/list',
    method: 'get',
    params: query
  });
}

// 分页查询订单列表
export function listOrderByPage(query) {
  return request({
    url: '/api/order/page',
    method: 'get',
    params: query
  });
}

// 查询产品
export function getOrder(orderNo) {
  return request({
    url: '/api/order/' + orderNo,
    method: 'get'
  });
}

// 新增产品
export function addOrder(data) {
  return request({
    url: '/api/order',
    method: 'post',
    data: data
  });
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/api/order',
    method: 'put',
    data: data
  });
}

// 删除订单
export function deleteOrder(orderNo) {
  return request({
    url: '/api/order/delete/' + orderNo,
    method: 'delete'
  });
}
